#!/usr/bin/env python
# -*- coding: utf-8 -*-
# !/usr/bin/env python
# -*- coding: utf-8 -*-
from functools import wraps

class DiyError(Exception):
    def __init__(self, message, *args, **kwargs):
        self.message = message
        self.args = args
        self.kwargs = kwargs

    def __call__(self, func):
        @wraps(func)
        def wrapper_func(*args, **kwargs):
            return func(*args, **kwargs)

        return wrapper_func

    def __str__(self):
        return self.message

    def __repr__(self):
        return self.message


class NetworkError(DiyError):
    pass

class TimeoutError(DiyError):
    pass

class DataError(DiyError):
    pass

class ExecError(DiyError):
    pass


class FileError(DiyError):
    pass


class ConfigError(DiyError):
    pass


class LogError(DiyError):
    pass
